package cc.atliberty.creating.multiobject;

/**
 * @Author 元宵
 * @url www.atliberty.cc
 * @Date 2023-10-30 18:53
 * @description: 有上限的多例类
 */
public class MultiObjectPatternTest {
    public static void main(String[] args) {
        Die die1 = Die.getInstance(1);
        Die die2 = Die.getInstance(2);
        for (int i = 0; i < 10; i++) {
            System.out.println(die1.dice() + die2.dice());
        }
    }
}
